class Car {
    constructor(number, name) {
        this.number = number;
        this.name = name;
    }

}

class ExpressCar extends Car{
    constructor(number, name) {
        super(number, name);
        this.price = 1;
    }
}

class SpecialCar extends Car {
    constructor(number, name) {
        super(number, name);
        this.price = 2;
    }
}

class Trip {
    constructor(car){
        this.car = car;
    }
    start(){
        // 显示车辆信息  
        alert(`车牌号：${this.car.number}，车名：${this.car.name}`);
    }
    end(){
        // 显示打车金额
        alert(`打车金额：${this.car.price * 5}`);
    }
}

{
    let specialCar = new SpecialCar('沪A11202', '奔驰专车'); // 打车2元
    let expressCar = new ExpressCar('沪A11111', '宝马快车'); // 打车1元

    let trip = new Trip(expressCar);
    trip.start();
    trip.end();
}